package br.com.foxinline.servico;

import br.com.foxinline.modelo.DoencaCardiaca;
import java.util.List;
import javax.ejb.Stateless;

/**
 *
 * @author laverson
 */
@Stateless
public class DoencaCardiacaServico extends ServicoGenerico<DoencaCardiaca> {

    public DoencaCardiacaServico() {
        super(DoencaCardiaca.class);
    }

    public List<DoencaCardiaca> autoComplete(String query) {
        List<DoencaCardiaca> results = getEntityManager().createQuery("select d from " + DoencaCardiaca.class.getSimpleName() + " d where lower(d.nome) like '%" + query.toLowerCase().trim() + "%'").getResultList();
        return results;
    }
}
